<?php

// Namespace

namespace Loop;


/**
 * CTestObjectF is used to test job manager
 */

class CTestObjectF extends \Loop\CObject
{
	/**
	 *
	 */

	public function api_basic()
	{
		$result = array('for basic API, it\'s ok !');	

		return $result;
	}


	/**
	 *
	 */

	public function api_functionWithArguments()
	{
		// Get parameters

		$ids = json_decode(fv('ids', true));
		$reference = fv('reference', false);


		// Call api

		$result = $this->functionWithArguments($ids, $reference);


		return $result;
	}


	/**
	 *
	 */

	public function api_throwException()
	{
		e(EXCEPTION_OBJECT_NOT_FOUND);
	}


	/**
	 *
	 */

	public function functionWithArguments($ids, $reference)
	{
		if(is_array($ids) === false)
		{
			return false;
		}

		if
		(
			$ids[0] != '1' &&
			$ids[1] !='2'
		)
		{
			return false;
		}

		if ($reference != '12345678')
		{
			return false;
		}


		return true;
	}

}


?>